feat(writer): broaden zone-map MIN/MAX to extension, Utf8, and dict columns#130
Merged
Conversation
…itive flushZoneMaps gated min/max on `DType.Primitive`, so extension columns (e.g. vortex.timestamp over I64) emitted NULL_COUNT-only zone-maps even though ExtEncoding already propagates the storage array's min/max scalars to each chunk. Generalise the gate via zoneStatPType, which unwraps an Extension to its storage primitive; the per-zone stat column is stored as that primitive, matching Rust (stats computed on the storage array). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Generalise flushZoneMaps min/max beyond primitives: vortex.varbin already records full string min/max scalars per chunk, so Utf8 columns now emit MAX/MIN (plus the always-false _is_truncated flags) in the per-zone stats table, matching ZonedStatsSchema (min/max dtype == column dtype) and Rust. zoneMinMaxDtype resolves the stored min/max dtype (primitive / extension storage / Utf8); zoneStatValues dispatches to the primitive or string stat-column builder. Binary is excluded — varbin records its bounds as string scalars, not bytes, so Binary min/max stays NULL_COUNT-only. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Rust computes zone-map stats on the logical column dtype, independent of the dict encoding, so dict columns carry MIN/MAX/NULL_COUNT like any other. The Java dict path emitted NULL_COUNT only — a parity gap. Compute per-chunk min/max on each chunk's logical values at dict-build time (reusing PrimitiveEncodingEncoder.minMaxStats / VarBinEncodingEncoder .minMaxStats, now exposed so the dict and flat paths stay identical) and carry them on DictColRef. Unify zone-map emission: both the flat and dict loops feed per-zone min/max scalar bytes + null counts through one emitZoneMap helper (replacing the dict-only NULL_COUNT writer), and the stat-column builders now take the scalar bytes directly. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the zone-map MIN/MAX gap for non-primitive columns. Ground-truthed against Rust's
default_zoned_aggregate_fns: zone-map stats are chosen from the logical column dtype, encoding-independent — so extension, Utf8, and dict columns all carry MIN/MAX/NULL_COUNT, not NULL_COUNT alone.Changes (3 commits)
flushZoneMapsunwrapsExtensionto its storage primitive (ExtEncodingalready propagates the storage min/max), viazoneStatPType→zoneMinMaxDtype.vortex.varbinalready records full string min/max scalars; emit them (plus the always-false_is_truncatedflags) per zone, matchingZonedStatsSchema(min/max dtype == column dtype).PrimitiveEncodingEncoder.minMaxStats/VarBinEncodingEncoder.minMaxStats, now exposed so dict and flat paths compute identically). Unified flat + dict emission through oneemitZoneMaphelper.Coverage
bytesFull
./mvnw verifygreen incl. integration/Rust interop + inspector decode + javadoc. NewWriterZoneMapTestcases cover extension, Utf8, and primitive/utf8 dict per-zone min/max.🤖 Generated with Claude Code